package com.ruoyi.web.pojo.dto.incomeexpense;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.web.domain.incomeexpense.IncomeExpense;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 支入支出对象 tt_income_expense
 * 
 * @author zq
 * @date 2024-01-09
 */
@EqualsAndHashCode(callSuper = true)
@Api("支入支出")
@Data
@NoArgsConstructor
public class IncomeExpensePage extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    private Long id;

    /** 用户ID */
    private Long userId;

    @ApiModelProperty("记录账户")
    @Excel(name = "记录账户")
    private String account;

    @ApiModelProperty("账户名称")
    @Excel(name = "账户名称")
    private String userName;

    /** 支入支出分类 */
    private String typeId;
    @ApiModelProperty("分类名称")
    @Excel(name = "分类名称")
    private String typeName;

    /** 子分类 */
    @ApiModelProperty("子分类")
    private String childId;

    @ApiModelProperty("子分类名称")
    @Excel(name = "二级分类名称")
    private String childName;

    @Excel(name = "来源")
    private String source;
    /** 金额 */
    @ApiModelProperty(value = "金额")
    @Excel(name = "金额")
    private BigDecimal money;

    /** 名称 */
    @ApiModelProperty(value = "名称 对应（租赁收入:出租对象,捐赠收入:来源,支出利息:还款对象,支付租金:支付对象,）")
    @Excel(name = "名称")
    private String name;

    /** 记录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date recordDate;

    /** 单价（元） */
    @ApiModelProperty(value = "单价（元）")
    @Excel(name = "单价(元)")
    private BigDecimal price;

    /** 数量 */
    @ApiModelProperty(value = "数量,对应（购买保险：投保数量）")
    @Excel(name = "数量")
    private Long number;

    /** 单位 */
    @ApiModelProperty(value = "单位")
    @Excel(name = "单位")
    private String unit;

    /** 附件 */
    @ApiModelProperty(value = "附件")
    private String pic;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 保险公司 */
    @ApiModelProperty(value = "保险公司")
    @Excel(name = "保险公司")
    private String insuranceCompany;

    /** 保险产品 */
    @ApiModelProperty(value = "保险产品")
    @Excel(name = "保险产品")
    private String insurance;

    @ApiModelProperty("赔付原因")
    @Excel(name = "赔付原因")
    private String compensate;
    @ApiModelProperty("状态")
    private String state;
    @Excel(name = "备注")
    private String remark;

    public  IncomeExpensePage (IncomeExpense in) {
        this.setId(in.getId());
        this.setUserId(in.getUserId());
        this.setTypeId(in.getTypeId());
        this.setChildId(in.getChildId());
        this.setMoney(in.getMoney());
        this.setName(in.getName());
        this.setRecordDate(in.getRecordDate());
        this.setPrice(in.getPrice());
        this.setNumber(in.getNumber());
        this.setUnit(in.getUnit());
        this.setPic(in.getPic());
        this.setDelFlag(in.getDelFlag());
        this.setInsuranceCompany(in.getInsuranceCompany());
        this.setInsurance(in.getInsurance());
        this.setCompensate(in.getCompensate());
        this.remark = in.getRemark();


    }
}
